﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;
using System.Collections;

namespace Atosenet.PluginEngine
{
    public class PluginCollection : BaseCollection<IPlugin>
    {
        #region 核心函数

        protected override void InsertItem(int index, IPlugin item)
        {
            /* 此处日后定义区别Plugin的方法 */
            //if(this.Exists((plugin)=>{ return plugin.PluginName

            if (!this.Contains(item))
                base.InsertItem(index, item);
        }

        #endregion


        #region 属性

        public IPlugin this[string pluginName]
        {
            get
            {
                return Find((plugin) => { return plugin.PluginName == pluginName; });
            }
        }

        #endregion
    }
}
